HTML (HyperText Markup Language) is the standard markup language for creating web pages. It consists of elements wrapped in tags that define the structure of your content. Every HTML document has a basic structure that the browser uses to render the page correctly.
<!DOCTYPE html> declares the document type and HTML version<html> is the root element that wraps all content<head> contains meta information, title, and links to resources<body> contains all the visible content of your webpage<tag> and closing </tag>lang attribute helps with accessibility and SEOmeta charset="UTF-8" ensures proper character encodingHTML provides six levels of headings from <h1> to <h6> to structure your content hierarchically. Paragraphs are created with the <p> tag, and you can format text with tags like <strong>, <em>, and others for emphasis and styling.
<h1> should be used for main titles (only one per page for SEO)h1 > h2 > h3, etc.) for proper document structure<p> tags automatically add spacing before and after paragraphs<strong> for important text and <em> for emphasis (preferred over <b> and <i>)<u> underlines text, while <code> displays code snippets<br> creates line breaks (avoid overusing)<hr> creates thematic breaks between sectionsThe <a> tag creates hyperlinks to other pages or resources, while the <img> tag embeds images in your document. These elements are essential for creating rich, interconnected web experiences and visual content.
href attribute specifies the link destination (URL or fragment)target="_blank" opens links in a new tab (use with rel="noopener" for security)src attribute for the image source (URL or path)alt attribute provides alternative text for accessibility (required)width and height attributes for proper layoutabout.html or images/photo.jpg)HTML supports ordered (<ol>), unordered (<ul>), and description (<dl>) lists for organizing content. Tables (<table>) are used for displaying tabular data with rows (<tr>), headers (<th>), and cells (<td>).
<ul> for bullet-point lists and <ol> for numbered lists<li> tags<dl> creates description lists with terms (<dt>) and definitions (<dd>)<tr> for rows, <th> for headers, and <td> for data cells<thead>, <tbody>, and <tfoot> for better semanticscolspan and rowspan merge cells horizontally/vertically<caption> provides a title for the tableHTML forms (<form>) allow users to enter data that can be sent to a server. They contain various input elements like text fields, checkboxes, radio buttons, dropdowns, and more, making web pages interactive.
<form> element wraps all form controlsaction specifies where to send form datamethod defines how to send data (GET or POST)<label> elements for accessibilitytype attributes create different inputs (text, email, password, etc.)required makes a field mandatoryplaceholder shows example textname for single selection<fieldset> and <legend>novalidate to disable browser validation when neededSemantic HTML elements clearly describe their meaning to both the browser and developer. They improve accessibility, SEO, and make code easier to understand. Modern HTML5 introduced many semantic elements to replace generic <div> elements.
<header> represents introductory content or navigation<nav> contains major navigation blocks<main> holds the primary content (only one per page)<article> encloses self-contained, reusable content<section> groups thematically related content<aside> contains tangentially related content<footer> represents footer content for its nearest ancestor<figure> and <figcaption> for images/media with captions<time> for machine-readable dates/times<address> for contact informationUse this space to experiment with everything you've learned. Try combining different HTML elements and see the results in real-time! This is your sandbox to practice and explore.
style attributevar(--primary) - Main green color (#04fc42)var(--primary-dark) - Darker green (#03c734)var(--primary-light) - Light green background (#e0ffe8)var(--primary-extra-light) - Very light green (#f5fff7)